<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title></title>
</head>
<body>

    <button id="step1">button1</button>
    <button id="step2">button2</button>
    <button id="step3">button3</button>

<script>
    !function(window, document, undefined) {
        var btns = document.querySelectorAll('button');

        for (var i=0; i<btns.length; i++) {
            btns[i].onclick = function() {
                var id = this.id;
                window.location.hash = id;
            }
        }

    }(window, document);
</script>
</body>
</html>